//
// Created by liuxc on 25-8-10.
//

#ifndef GAMEPADSTATE_H
#define GAMEPADSTATE_H

#include <QMainWindow>

#include <array>

//摇杆数据归一化之后的值 结构体
typedef struct {
    // 左右摇杆
    struct Axis {
        float x = 0.0f; // -1.0 .. 1.0
        float y = 0.0f;
    } leftAxis, rightAxis;

    // 左右扳机
    float leftTrigger = 0.0f; // 0.0 .. 1.0
    float rightTrigger = 0.0f;

    // 常用按钮：A B X Y  LB RB  Back Start  Guide  L3 R3  D-Pad
    struct {
        bool A;
        bool B;
        bool X;
        bool Y;

        bool LeftBumper; //左肩键
        bool RightBumper;//右肩键

        bool Back; //返回
        bool Start; //开始
        bool Home;

        bool LeftStick; //左摇杆按下
        bool RightStick; //右摇杆按下

        bool DPadUp; //方向上
        bool DPadDown; //方向下
        bool DPadLeft; //方向左
        bool DPadRight; //方向右
    }buttons;

    // 常用按钮：A B X Y  LB RB  Back Start  Guide  L3 R3  D-Pad
    struct {
        bool A;
        bool B;
        bool X;
        bool Y;

        bool LeftBumper; //左肩键
        bool RightBumper;//右肩键

        bool Back; //返回
        bool Start; //开始
        bool Home;

        bool LeftStick; //左摇杆按下
        bool RightStick; //右摇杆按下

        bool DPadUp; //方向上
        bool DPadDown; //方向下
        bool DPadLeft; //方向左
        bool DPadRight; //方向右
    }buttons_last;
} GamepadState_t;


#endif //GAMEPADSTATE_H
